package dpe;

public class GameObject {
	protected Vec3 pos = new Vec3();
	protected Vec3 rot = new Vec3();
	protected Vec3 vel = new Vec3();
	protected Vec3 size = new Vec3();
	protected String name;
	protected boolean visible = true;
	protected float r, g, b;
	
	protected World world;
	
	public GameObject(World world, String name) {
		this.world = world;
		if (name != null) this.name = name;
	}
	
	public GameObject(World world, String name, Vec3 pos) {
		this.world = world;
		if (pos != null)  this.pos = pos;
	}

	public GameObject(World world, String name, Vec3 pos, Vec3 size) {
		this(world, name);
		if (pos != null) this.pos = pos;
		if (size != null) this.size = size;
	}

	public void init() {

	}

	public void update() {

	}

	public void render() {

	}
	
	public void move(Vec3 d) {
		pos.add(d);
	}
	
	public void setPos(Vec3 newPos) {
		pos = newPos;
	}
	
	public void setRot(Vec3 newRot) {
		rot = newRot;
	}
	
	public void setSize(Vec3 newSize) {
		size = newSize;
	}
	
	public Vec3 getPos() {
		return pos;
	}
	
	public Vec3 getRot() {
		return rot;
	}

	public float getPosX() {
		return pos.x;
	}
	public float getPosY() {
		return pos.y;
	}
	public float getPosZ() {
		return pos.z;
	}
	
	public float getSizeX() {
		return size.x;
	}
	public float getSizeY() {
		return size.y;
	}
	public float getSizeZ() {
		return size.z;
	}

	public void setVisible(boolean b) {
		visible = b;
	}
	
	public boolean isVisible() {
		return visible;
	}

	public void setColor(float r, float g, float b) {
		this.r = r;
		this.g = g;
		this.b = b;
	}

	public String getName() {
		return name;
	}

	public void setEvent(String name) {
		
	}
}
